<template>
  <div class="container">
    <van-nav-bar fixed title="分类" />
    <van-grid :column-num="2" v-for="item in cateList" :key="item.id">
      <van-grid-item to="/list" :icon="item.icon" :text="item.catename" />
      <!-- <van-grid-item to="/list" icon="photo-o" text="科技" />
      <van-grid-item to="/list" icon="photo-o" text="图片" />
      <van-grid-item to="/list" icon="photo-o" text="时政" />
      <van-grid-item to="/list" icon="photo-o" text="科技" />
      <van-grid-item to="/list" icon="photo-o" text="图片" /> -->
    </van-grid>
  </div>
</template>

<script>
import axios from 'axios'
export default {
  data() {
    return {
      cateList: [],
    };
  },
  created() {
    this.getCateList();
  },
  methods: {
    async getCateList() {
      const { data } = await axios.get(
        "http://124.223.14.236:8060/home/index/index"
      );
      console.log(data);
      this.cateList.push(...data.data.allCate)
    },
  },
};
</script>

<style scoped lang="less">
</style>